package com.tk.ehr.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tk.ehr.mapper.SysMenuMapper;
import com.tk.ehr.model.entity.SysMenu;
import com.tk.ehr.service.SysMenuService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class SysMenuServiceImpl implements SysMenuService {

  @Resource
  private SysMenuMapper sysMenuMapper;

  @Override
  public int deleteByPrimaryKey(Long menuId) {
    return sysMenuMapper.deleteByPrimaryKey(menuId);
  }

  @Override
  public int insert(SysMenu record) {
    return sysMenuMapper.insert(record);
  }

  @Override
  public int insertSelective(SysMenu record) {
    return sysMenuMapper.insertSelective(record);
  }

  @Override
  public SysMenu selectByPrimaryKey(Long menuId) {
    return sysMenuMapper.selectByPrimaryKey(menuId);
  }

  @Override
  public int updateByPrimaryKeySelective(SysMenu record) {
    return sysMenuMapper.updateByPrimaryKeySelective(record);
  }

  @Override
  public int updateByPrimaryKey(SysMenu record) {
    return sysMenuMapper.updateByPrimaryKey(record);
  }

  @Override
  public List<SysMenu> list() {
    return sysMenuMapper.list();
  }

  @Override
  public PageInfo<SysMenu> page(Integer pageNum, Integer pageSize) {
    PageHelper.startPage(pageNum, pageSize);
    return PageInfo.of(sysMenuMapper.list());
  }
}
